package com.SmartCampus.system.service.impl;

import com.SmartCampus.system.mapper.AnnouncementMapper;
import com.SmartCampus.system.model.dto.announcement.AnnouncementQueryRequest;
import com.SmartCampus.system.model.entity.Announcement;
import com.SmartCampus.system.service.AnnouncementService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * @author wangliang
 * @description 针对表【announcement(通知公告表)】的数据库操作Service实现
 * @createDate 2024-12-26 18:54:38
 */
@Service
public class AnnouncementServiceImpl extends ServiceImpl<AnnouncementMapper, Announcement> implements AnnouncementService {

    @Override
    public Page<Announcement> getAnnouncementByAll(Page<Announcement> page, AnnouncementQueryRequest announcementQueryRequest) {
        QueryWrapper<Announcement> queryWrapper = new QueryWrapper<>();
        return page(page, queryWrapper);
    }

    @Override
    public Page<Announcement> getAnnouncementByMy(Page<Announcement> page, AnnouncementQueryRequest announcementQueryRequest, String username) {
        QueryWrapper<Announcement> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("author", username);
        return page(page, queryWrapper);
    }
}




